import request from '@/utils/request'

// 查询商品分类列表
export function listGoodsClass(query) {
  return request({
    url: '/goods/goodsClass/list',
    method: 'get',
    params: query
  })
}

// 查询商品分类详细
export function getGoodsClass(id) {
  return request({
    url: '/goods/goodsClass/' + id,
    method: 'get'
  })
}

// 新增商品分类
export function addGoodsClass(data) {
  return request({
    url: '/goods/goodsClass',
    method: 'post',
    data: data
  })
}

// 修改商品分类
export function updateGoodsClass(data) {
  return request({
    url: '/goods/goodsClass',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function delGoodsClass(id) {
  return request({
    url: '/goods/goodsClass/' + id,
    method: 'delete'
  })
}

// 分类状态修改
export function changeClassStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/goods/goodsClass/changeStatus',
    method: 'put',
    data: data
  })
}
